package com.hzit.listener;

import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;

/**
 * 类名：
 * 作者：WF
 * 功能：对请求对象及请求对象的属性值的监听
 */
@WebListener
public class MyRequestListener implements ServletRequestListener, ServletRequestAttributeListener {

	@Override
	public void requestInitialized(ServletRequestEvent sre) {
		System.out.println("开始创建一个新的请求...");
	}
	@Override
	public void requestDestroyed(ServletRequestEvent sre) {
		System.out.println("销毁请求对象...");
	}

	@Override
	public void attributeAdded(ServletRequestAttributeEvent srae) {
		System.out.println("为请求对象添加一个属性值时。。。");
	}

	@Override
	public void attributeRemoved(ServletRequestAttributeEvent srae) {
		System.out.println("为请求对象移除一个属性值时。。。");
	}

	@Override
	public void attributeReplaced(ServletRequestAttributeEvent srae) {

	}

}
